<template>
  <div id="app">
    <router-view style="height: 100%" />
  </div>
</template>
<script>
import { getAppByType } from "@/api/app";

export default {
  created() {
    this.initData();
  },
  methods: {
    initData() {
      getAppByType(0).then(res => {
        this.$store.dispatch("set_appdata", { item: res, type: 0 });
      });
      getAppByType(1).then(res => {
        this.$store.dispatch("set_appdata", { item: res, type: 1 });
      });
      getAppByType(2).then(res => {
        this.$store.dispatch("set_appdata", { item: res, type: 2 });
      });
      return null;
    }
  }
};
</script>
<style>
#app {
  font-family: Avenir, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #2c3e50;
  height: 100%;
  min-height: 100%;
}

#nav {
  padding: 30px;
}

#nav a {
  font-weight: bold;
  color: #2c3e50;
}

#nav a.router-link-exact-active {
  color: #42b983;
}
</style>
